public class CommandArgsThree
{
	
	
public static void main(String [] args)
{
	
	
	
	
	
	
	
	
	
	final StringBuffer a = new StringBuffer();
	final StringBuffer b = new StringBuffer();
	new Thread()
	{
	public void run()
	{
	System.out.print(a.append("A"));
	synchronized(b)
	{
	System.out.print(b.append("B"));
	}}}.start();
	new Thread()
	{
	public void run()
	{
	System.out.print(b.append("C"));
	synchronized(a)
	{
	System.out.print(a.append("D"));
	}
	}
	}.start();
	
	} 
	
	
	
	
	
	
	
	
	/*
	String a = "ABCD";
	String b = a.toLowerCase();
	String n=b.replace('a','d');
	System.out.println(n);
	String m=	b.replace('b','c');
System.out.println(m);
	System.out.println(b);
	
	
	/*
	
String a = "newspaper";
a = a.substring(5,7);
System.out.println(a);
char b = a.charAt(1);
System.out.println(b);
a = a + b;
System.out.println(a);


/*
int [] [] [] x = new int [3] [] [];
int i, j;
x[0] = new int[4][];
x[1] = new int[2][];
x[2] = new int[5][];
for (i = 0; i < x.length; i++)
{
	System.out.println("pahla loop"+x.length);
for (j = 0; j < x[i].length; j++)
{
x[i][j] = new int [i + j + 1];
System.out.println("size = " + x[i][j].length);

}
}
*/
}